# 存储多项式基函数的 函数值 导数值 左右端点值 质量mm
# 这里计算的是local区间
import numpy as np
import config
import getGLP

weight, lambda_ = getGLP.load_GLP(config.NumGLP)
phiG = np.zeros((config.NumGLP, config.dimPk))  # 存储高斯点上基函数的值
phixG = np.zeros((config.NumGLP, config.dimPk))  # 存储高斯点上基函数导数的值
phiGR = np.zeros((config.dimPk,))  # 存储右端点上基函数的值
phiGL = np.zeros((config.dimPk,))  # 存储左端点上基函数的值
mm = np.zeros((config.dimPk)) 


# 只考虑k=2的情况 (dimPk=3)
for i in range(config.NumGLP):
    phiG[i, 0] = 1.0
    phiG[i, 1] = lambda_[i]
    phiG[i, 2] = lambda_[i] ** 2 - 1.0 / 3.0
    
    phixG[i, 0] = 0.0
    phixG[i, 1] = 1.0 / config.hx1
    phixG[i, 2] = 2.0 * lambda_[i] / config.hx1
    
phiGL[0] = 1.0
phiGL[1] = -1.0
phiGL[2] = 2.0 / 3.0

phiGR[0] = 1.0
phiGR[1] = 1.0
phiGR[2] = 2.0 / 3.0

mm[0] = 1.0
mm[1] = 1.0 / 3.0
mm[2] = 4.0 / 45.0